package com.blog.mapper;

import com.blog.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 用户持久层
 *
 * @author wmb
 *
 * @since 2021-27
 */
@Mapper
@Repository("userMapper")
public interface UserMapper {

    /**
     * 根据用户名和密码获取user
     *
     * @param username 用户名
     * @param password 密码
     *
     * @return
     */
    User getUserInfoByCond(@Param("username") String username, @Param("password") String password);

    /**
     * 根据主键编号获取用户信息
     *
     * @param uid
     *
     * @return
     */
    User getUserInfoById(@Param("uid") Integer uid);

    /**
     * 更改用户信息
     *
     * @param user
     *
     * @return
     */
    int updateUserInfo(User user);
}
